package com.kanshu.ksgb.fastread.doudou.module.book.service;

import android.content.Context;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.kanshu.ksgb.fastread.doudou.app.constants.ARouterConfig;
import com.kanshu.ksgb.fastread.doudou.module.reader.utils.ThemeManager;
import com.kanshu.ksgb.fastread.doudou.common.business.routerservice.BookBussinessService;
import com.kanshu.ksgb.fastread.doudou.module.book.presenter.BookPresenter;
import com.kanshu.ksgb.fastread.doudou.module.reader.utils.ObtainAllSimpleChaptersHelper;

/**
 * 作者    wcy
 * 时间    2018/12/5 22:59
 * 文件    doudou
 * 描述
 */
@Route(path = ARouterConfig.BOOK_BUSSINESS_SERVICE)
public class BookBussinessServiceImpl implements BookBussinessService {
    @Override
    public void addToShelf(String bookId) {
        BookPresenter presenter = new BookPresenter(null);
        presenter.joinBookShelf(bookId);
    }

    @Override
    public void delFromShelf(String bookId) {
        BookPresenter presenter = new BookPresenter(null);
        presenter.delFromBookShelf(bookId);
    }

    @Override
    public void getAllSimpleChapters(String bookId) {
        // 先获取所有章节信息
        ObtainAllSimpleChaptersHelper.getAllSimpleChaptersByForce(bookId, true);
    }

    @Override
    public void clearReference() {
        ThemeManager.clear();
    }

    @Override
    public void init(Context context) {

    }
}
